revert(gazelle): revert #1895 as it is causing issues cross-building the plugin#1931
revert(gazelle): revert #1895 as it is causing issues cross-building the plugin#1931aignas wants to merge 1 commit intobazel-contrib:mainfrom
Conversation
This reverts commit 7fc7962. Fixes bazel-contrib#1913
|
Bummer! I really liked the pure golang helper, haha. Good thing Bazel 7.2.0rc1 is out and I can use I agree that most options are less than ideal. What does the 2nd option (re-implement) actually consist of? What are the risks? |
|
We can potentially keep the part of using pypi/stdlib-list to resolve stdlib, which doesn't rely on C. There are some Python parsers written in pure Go that we can potentially use. Not sure how good they are. |
@dougthor42, your comment suggests that merging this PR would be a mistake, because at least multiple people would use The reimplementation of the parser should not be too hard because we cane about a very small subset of the language:
The problem could be that Python is dynamic and it may have these statements within functions, which could means that we do need at least a decent parser to do that.
@linzhp, Agree, having the I'll make this PR a draft, but leave it open in case I hear good reasons for it to be merged. If we just put the |
Looks like github.com/go-python/gpython/parser is a decent one |
This reverts commit 7fc7962.
#1895 has introduced a way to parse Python files without the need for
Python interpreter by leveraging the
tree-sitterbindings for go.However, those bindings introduced a
Cdependency and as a result itwas breaking the cross-compilation of the
gazelleplugin.The alternatives to revert are:
tree-sitter, which would benefit users who don't needcross-compilation by speeding up
gazellesignifficantly. As@dougthor42 showed, the
tree-sitterimplementation is 3 timesfaster, which is a great performance win.
care about in pure go.
there is no way to get the OSX sysroot on anything else than OSX os,
this is not trivial to do.
None of the alternatives look appealing due to increased maintenance or
effort, hence the only real alternative for the time being is to revert.
If the cross compilation of
CGOprograms becomes better, then we canlook at reverting this revert and using
tree-sitterin the future.Fixes #1913